

package scene

import (
	"cgs-server/server/model"
	"go.mongodb.org/mongo-driver/bson/primitive"
	"time"
)

// Model is scene model.
type Model struct {
	// ID
	ID primitive.ObjectID `json:"ID" bson:"ID"`
	// Name
	Name string	`json:"Name" bson:"Name"`
	// Category ID
	CategoryID string `json:"CategoryID" bson:"CategoryID"`
	// Category Name
	CategoryName string `json:"CategoryName" bson:"CategoryName"`
	// Total PinYin
	TotalPinYin string	`json:"TotalPinYin" bson:"TotalPinYin"`
	// The First Letters of Total PinYin
	FirstPinYin string	`json:"FirstPinYin" bson:"FirstPinYin"`
	// Collection Name
	CollectionName string	`json:"CollectionName" bson:"CollectionName"`
	// Version
	Version *int32	`json:"Version" bson:"Version"`
	// Create Time
	CreateTime time.Time	`json:"CreateTime" bson:"CreateTime"`
	// Update Time
	UpdateTime time.Time	`json:"UpdateTime" bson:"UpdateTime"`
	// Thumbnail
	Thumbnail string	`json:"Thumbnail" bson:"Thumbnail"`
	// Is Public
	IsPublic *bool	`json:"IsPublic" bson:"IsPublic"`
	// The user who the scene belong to
	Username string	`json:"Username" bson:"Username"`
	// Data scene data
	Data string `json:"Data" bson:"-"`

	DataArr []interface{} `json:"-" bson:"-"`

	model.TenantModel `json:",inline" bson:",inline"`
}

func (m *Model) SetId(id primitive.ObjectID) {
	m.ID = id
}
func (m *Model) GetId() string {
	return m.ID.Hex()
}

type AddModel struct {
	Model
	IDObjId	primitive.ObjectID
	UserId string
	Data []interface{}
}
